package com.ruoyi.zhhq.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zhhq.mapper.BuildingMapper;
import com.ruoyi.zhhq.domain.Building;
import com.ruoyi.zhhq.service.IBuildingService;

/**
 * 楼Service业务层处理
 * 
 * @author zsl
 * @date 2022-10-30
 */
@Service
public class BuildingServiceImpl implements IBuildingService 
{
    @Autowired
    private BuildingMapper buildingMapper;

    /**
     * 查询楼
     * 
     * @param buildingId 楼主键
     * @return 楼
     */
    @Override
    public Building selectBuildingByBuildingId(String buildingId)
    {
        return buildingMapper.selectBuildingByBuildingId(buildingId);
    }
    /**
     * 查询房间信息列表
     * 
     * @param Room 系部信息
     * @return 房间信息集合
     */
    
    public Building selectBuildingByBuildingName(String buildingName) {
    	
    	return buildingMapper.selectBuildingByBuildingName(buildingName);
    }

    /**
     * 查询楼列表
     * 
     * @param building 楼
     * @return 楼
     */
    @Override
    public List<Building> selectBuildingList(Building building)
    {
        return buildingMapper.selectBuildingList(building);
    }
    
    /**
     * 查询楼列表
     * 
     * @param building 楼
     * @return 楼
     */
    @Override
    public List<Building> selectBuildingListAll()
    {
        return buildingMapper.selectBuildingListAll();
    }
    
    /**
     * 新增楼
     * 
     * @param building 楼
     * @return 结果
     */
    @Override
    public int insertBuilding(Building building)
    {
        building.setCreateTime(DateUtils.getNowDate());
        return buildingMapper.insertBuilding(building);
    }

    /**
     * 修改楼
     * 
     * @param building 楼
     * @return 结果
     */
    @Override
    public int updateBuilding(Building building)
    {
        building.setUpdateTime(DateUtils.getNowDate());
        return buildingMapper.updateBuilding(building);
    }

    /**
     * 批量删除楼
     * 
     * @param buildingIds 需要删除的楼主键
     * @return 结果
     */
    @Override
    public int deleteBuildingByBuildingIds(String[] buildingIds)
    {
        return buildingMapper.deleteBuildingByBuildingIds(buildingIds);
    }

    /**
     * 删除楼信息
     * 
     * @param buildingId 楼主键
     * @return 结果
     */
    @Override
    public int deleteBuildingByBuildingId(String buildingId)
    {
        return buildingMapper.deleteBuildingByBuildingId(buildingId);
    }
}
